﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09.WriteASumOfFiveNumbersIfZero
{
    class FiveNumbersIsZero
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Insert five int number");
            Console.Write("a= ");
            string first = Console.ReadLine(); 
            Console.Write("b= ");
            string second = Console.ReadLine();
            Console.Write("c= ");
            string third = Console.ReadLine();
            Console.Write("d= ");
            string fourth = Console.ReadLine(); 
            Console.Write("e= ");
            string fifth = Console.ReadLine();
            int a, b, c, d, e;
            if (int.TryParse(first, out a))
            {
                Console.Write("");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("a is not an int.Try again later!!!",a);
            }
            if (int.TryParse(second, out b))
            {
                Console.Write("");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("b is not an int.Try again later!!!",b);
            }
            if (int.TryParse(third, out c))
            {
                Console.Write("");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("c is not an int.Try again later!!!",c);
            }
            if (int.TryParse(fourth, out d))
            {
                Console.Write("");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("d is not an int.Try again later!!!",d);
            }
            if (int.TryParse(fifth, out e))
            {
                Console.Write("");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("e is not an int.Try again later!!!",e);
            }
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            //two
            if ((a + b) == 0)
            {
                Console.WriteLine("a = {0}; b = {1}; a + b = {2}", a, b, a + b);
            }
            if ((a + c) == 0)
            {
                Console.WriteLine("a = {0}; c = {1}; a + c = {2}", a, c, a + c);
            }
            if ((a + d) == 0)
            {
                Console.WriteLine("a = {0}; d = {1}; a + d = {2}", a, d, a + d);
            }
            if ((a + e) == 0)
            {
                Console.WriteLine("a = {0}; e = {1}; a + e = {2}", a,e, a + e);
            }
            if ((b + c) == 0)
            {
                Console.WriteLine("b = {0}; c = {1}; b + c = {2}", b, c, b + c);
            }
            if ((b + d) == 0)
            {
                Console.WriteLine("b = {0}; d = {1}; b + d = {2}", b, d, b + d);
            }
            if ((b + e) == 0)
            {
                Console.WriteLine("b = {0}; e = {1}; b + e = {2}", b, e, b + e);
            }
            if ((c + d) == 0)
            {
                Console.WriteLine("c = {0}; d = {1}; c + d = {2}",c, d, c + d);
            }
            if ((c + e) == 0)
            {
                Console.WriteLine("c = {0}; e = {1}; c + e = {2}", c, e, c + e);
            }
            if ((d + e) == 0)
            {
                Console.WriteLine("d = {0}; e = {1}; d + e = {2}", d, e, d + e);
            }
            //three
            if ((a + b + c) == 0)
            {
                Console.WriteLine("a = {0}; b = {1}; c = {2}; a + b + c = {3}", a, b,c, a+b+c);
            }
            if ((a + b + d) == 0)
            {
                Console.WriteLine("a = {0}; b = {1};d = {2}; a + b + d = {3}", a, b, d, a + b +d);
            }
            if ((a + b + e) == 0)
            {
                Console.WriteLine("a = {0}; b = {1};e = {2}; a + b +e = {3}", a, b,e, a + b + e);
            }
            if ((a + c + d) == 0)
            {
                Console.WriteLine("a = {0}; c = {1}; d = {2}; a + c + d= {3}", a, c, d, a + c + d);
            }
            if ((a + c + e) == 0)
            {
                Console.WriteLine("a = {0};c = {1};e = {2}; a + c + e = {3}", a, c, e, a + c + e);
            }
            if ((a + d + e) == 0)
            {
                Console.WriteLine("a = {0}; d = {1}; e = {2}; a + d + e = {3}", a, d, e, a +d + e);
            }
            if ((b + c + d) == 0)
            {
                Console.WriteLine("b = {0};c = {1}; d = {2}; b + c + d = {3}", b, c, d, b + c + d);
            }

            if ((b + c + e) == 0)
            {
                Console.WriteLine("b = {0};c = {1}; e = {2}; b + c + e = {3}", b, c, e, b + c + e);
            }

            if ((b + d + e) == 0)
            {
                Console.WriteLine("b = {0};d = {1}; e= {2}; b + d + e = {3}", b, d, e, b + d + e);
            }

            if ((c + d + e) == 0)
            {
                Console.WriteLine("c = {0};d = {1};e= {2}; c + d + e = {3}", c, d, e, c +d + e);
            }
            //four
            if ((a + b + c + d) == 0)
            {
                Console.WriteLine("a= {0};b = {1}; c = {2}; d = {3}; a + b + c + d = {4}", a, b, c,d ,a + b + c + d);
            }
            if ((a + b + c + e) == 0)
            {
                Console.WriteLine("a= {0};b = {1}; c = {2}; e = {3}; a + b + c + e = {4}", a, b, c, e, a + b + c + e);
            }
            if ((a + b + d + e) == 0)
            {
                Console.WriteLine("a= {0};b = {1}; d = {2}; e = {3}; a + b + d + e = {4}", a, b, d, e, a + b + d + e);
            }
            if ((a + c + d + e) == 0)
            {
                Console.WriteLine("a= {0};c = {1}; d = {2}; e = {3}; a + c + d + e = {4}", a, c,d, e, a + c + d + e);
            }
            if ((b + c + d + e) == 0)
            {
                Console.WriteLine("b= {0};c = {1}; d = {2}; e = {3}; b + c + d + e = {4}", b, c, d, e, b + c + d + e);
            }
            //five
            if((a+b+c+d+e)==0)
            {
                Console.WriteLine("a = {0}; b = {1}; c = {2}; d = {3}; e = {4}; a+b+c+d+e = {5}",a,b,c,d,e,a+b+c+d+e);
            }
        }   
    }
}
